import applicationAdminApiConfig from '@/core/application/generated/apiconfig/applicationAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import AppApplicationConfigResponse from '@/core/application/generated/types/model/response/AppApplicationConfigResponse'

const content: AppApplicationConfigResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		appId: i.toString(),
		title: `title_应用配置_${i.toString()}`,
		configKey: `configKey_应用配置_${i.toString()}`,
		config: `config_应用配置_${i.toString()}`,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as AppApplicationConfigResponse)
}

const mockList: MockMethod[] = [
	...serverApiMockUtils.getDefaultServerApi(applicationAdminApiConfig.appApplicationConfig, content),
]

mockProdServerUtils.addMockList(...mockList)

export const items = content
